package com.ztf.grouptask;

import java.util.HashMap;
import java.util.Map;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.junit.Test;

public class GroupTask3Test {
    @Test
    public void testDeploy(){
        //获取流程引擎
        ProcessEngine processEngine =  ProcessEngines.getDefaultProcessEngine();
        processEngine.getRepositoryService()
                .createDeployment()
                .addClasspathResource("com/itheima09/activiti5/grouptask/grouptask3.bpmn")
                .deploy();
    }

    /**
     * 启动流程实例
     */
    @Test
    public void testStartProcessInstance(){
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        processEngine.getRuntimeService()
                //.getIdentityLinksForProcessInstance(null); 可以根据流程实例ID获取到当前流程实例正在执行的组任务的候选人
                .startProcessInstanceById("grouptask3:1:3204");
    }

    @Test
    public void testClaimTask(){
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        processEngine.getTaskService()
                .claim("3105", "王二麻子");
    }
}
